package com.java.controller.api;


import com.java.pojo.entity.Dict;
import com.java.result.Result;
import com.java.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 数据字典 前端控制器
 * </p>
 *
 * @author Helen
 * @since 2021-07-08
 */
@Api("数据字典")
@RestController
@RequestMapping("/api/core/dict")
public class DictController {

    @Resource
    private DictService dictService;

    @ApiOperation("获取数据字典子节点")
    @GetMapping("getDict/{dictCode}")
    public Result getDictByDictCode(@PathVariable String dictCode){
        List<Dict> list = dictService.getDictsByDictCode(dictCode);
        return Result.ok(list);
    }

}

